[.Net/Reflection] Getting the .Net corresponding type of a C# type

Posted by Serious on Stack Overflow See other posts from Stack Overflow or by Serious
Published on 2009-09-22T12:59:27Z Indexed on 2011/01/09 6:53 UTC
Read the original article Hit count: 210

Filed under:
|
|
|

Hello,

is there a function that, given a C# type's string representation, returns the corresponding .Net type or .Net type's string representation; or any way to achieve this.

For example :

"bool" -> System.Boolean or "System.Boolean"

"int" -> System.Int32 or "System.Int32"

...

Thanks.

Edit : really sorry, it's not a "type to type" mapping that I wish but either a "string to string" mapping or a "string to type" mapping.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET